import {Component, ElementRef, OnInit, QueryList, ViewChild, ViewChildren} from '@angular/core';

@Component({
  selector: 'app-basic',
  templateUrl: './basic.component.html',
  styles: [
  ]
})
export class BasicComponent implements OnInit {
  @ViewChild("paragraph") paragraph: ElementRef<HTMLParagraphElement> | undefined
  @ViewChildren("items") items: QueryList<HTMLLIElement> | undefined

  message = 'hello'
  a = 1;
  b = 1;
  htmlSnippet = '<div style="background-color: #f2f2f2">芜湖</div>'
  username : string = ""

  task = {
    person: {
      name: '张三'
    }
  }

  constructor() { }

  ngOnInit(): void {
  }
  ngAfterViewInit() {
    console.log(this.paragraph?.nativeElement)
    console.log(this.items?.toArray())
  }
  getInfo(){
    return 'leeya'
  }

  onSave(event: Event){
    console.log(event)
  }
  onKeyUp(event: Event){
    console.log(event)
  }
  change(){
    this.username = "hello Angular"
  }
}
